﻿using System;
using System.Data.Entity.ModelConfiguration.Configuration;
using ENail.Domain.Core;
using Equation.Enterprise.Framework.Domain.Model;

namespace ENail.Domain.Data.Mapping
{
    public class ReceiptMapping : EntityMapping<Receipt>
    {
        public ReceiptMapping()
            : base("Receipt")
        {
            Property(x => x.Id).HasColumnName("ReceiptId");

            HasMany(x => x.ReceiptItems);

            HasRequired(x => x.Registration).WithOptional(x => x.Receipt).Map(x => x.MapKey("RegistrationId"));
        }
    }
}
